<!doctypehtml>
<html lang=cn>
<meta charset=utf-8>
<meta content="width=device-width,initial-scale=1" name=viewport>
<meta content="" name=description>
<title>记事本</title>
<link href="{{ url_for('static', filename='favicon.ico') }}" rel=icon type=image/x-icon>
<link href="{{ url_for('static', filename='favicon.ico') }}" rel="shortcut icon" type=image/x-icon>
<script src="{{ url_for('static', filename='editor/wangEditor.min.js') }}"></script>
<!--<script type="text/javascript" src="https://unpkg.com/wangeditor/dist/wangEditor.min.js"></script>-->
<link href="{{ url_for('static', filename='css/first.css') }}" rel=stylesheet>
<style>
    *{margin:0;padding:0}.toolbar{border:1px solid #ccc}.w-e-text-container{height:500px!important}table{border-top:1px solid #ccc;border-left:1px solid #ccc}table td,table th{border-bottom:1px solid #ccc;border-right:1px solid #ccc;padding:3px 5px}table th{border-bottom:2px solid #ccc;text-align:center}blockquote{display:block;border-left:8px solid #d0e5f2;padding:5px 10px;margin:10px 0;line-height:1.4;font-size:100%;background-color:#f1f1f1}code{display:inline-block;background-color:#f1f1f1;border-radius:3px;padding:3px 5px;margin:0 3px}pre code{display:block}ol,ul{margin:10px 0 10px 20px}
</style>
<script src="{{ url_for('static', filename='js/zepto.min.js') }}"></script>
<script>
    function getData(t) {
    return null == $(t).attr("data") || "" == $(t).attr("data") ? 0 : $(t).attr("data")
    }
    function loadArticle(t) {
        $.get("/article/" + getData(t) + "/",
        function(t) {
            $("#contentDiv").html(t)
        })
    }
    function createArticle(t) {
        $.get("/article/create/" + getData(t) + "/",
        function(t) {
            $("#contentDiv").html(t)
        })
    }
    function updateArticle(t) {
        $.get("/article/update/" + getData(t) + "/",
        function(t) {
            $("#contentDiv").html(t)
        })
    }
    function deleteArticle(t) { ! 0 === confirm("确定要删除吗？") && (window.location.href = "/article/delete/" + t + "/")
    }
    function colManage() {
        $.get("/col/",
        function(t) {
            $("#contentDiv").html(t)
        })
    }
    function find() {
        window.location.href = "/find?parameter=" + $("#parameter").val()
    }
    function clearZX() {
        window.location.href = "/clear"
    }
</script>
<div style=position:fixed;top:0;width:90%;height:60px;background-color:#fff;z-index:9999999>
    <div style=margin:2px>{% for menu in menus %}<span style=margin:4px><a href="/index/{{ menu.id }}/"> {{ menu.title }}</a>（{{ menu.coun }}）|</span>
        {% endfor %}
    </div>
    <hr>
    <div style=margin:2px>{% for lable in lables %}<span style=margin:4px><a href="/index/{{ lable.id }}/"> {{ lable.title }}</a>（{{ lable.coun }}）|</span>
        {% endfor %}
    </div>
    <div style=text-align:right>| <input id=parameter max=40>
        <button onclick=find()>搜索</button>
        |
        <button onclick=colManage()>管理栏目</button>
        |
        <button onclick=clearZX()>注销</button>
    </div>
</div>
<div style=overflow:scroll;position:fixed;left:0;width:150px;height:90%;background-color:#fff;z-index:9999999>
    <p>
        <button onclick=createArticle(this) data="{{ col }}" style=margin-left:20px>创建新文章</button>
    </p>
    {% for article in articles %}<p style="padding:4px 0 0 10px"><span data="{{ article.id }}"
                                                                       onclick=loadArticle(this)> {{ article.title }}</span>
    <hr>
    {% endfor %}
</div>
<div style=margin-top:80px;margin-left:180px;width:82%>
    <div id=contentDiv></div>
    <div style=height:80px></div>
</div>
